package com.iwat.logback.spring.boot.controller;



import com.iwat.logback.spring.boot.service.TestLogService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author wangweiqiang
 * @version 1.0
 * @date 2021-02-20 21:47
 */
@RestController
public class TestLogController {
    private final static Logger logger = LoggerFactory.getLogger(TestLogController.class);

    @Autowired
    private TestLogService testLogService;

    @GetMapping("/hello")
    public String hello(){
        logger.info("就测试一下");
        testLogService.printLogToSpecialPackage();

        return "hello logback";
    }}
